var express=require('express');
var app=express();
const api = require('./weather')
app.get('/',async function(req,res){
//  let dateTips = api.getDiffDate()
 let weather = await api.getWeatherTips()
 let words = await api.getDailyGreeting()
 let str =`${weather}\n${words}`
 res.writeHead(200, {'Content-Type': 'application/json; charset=utf-8'})
 res.end(str)
})
var server = app.listen(8083, function () { // 启动ip和端口
 var port = server.address().port
 console.log("应用实例，访问地址为 http://%s:%s", port)
})